import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution1200 {
    public List<List<Integer>> minimumAbsDifference(int[] arr) {
        int min=Integer.MAX_VALUE;
        Arrays.sort(arr);
        for (int i=0;i<arr.length-1;i++){
            min=Math.min(min,arr[i+1]-arr[i]);
        }
        List<List<Integer>> ans=new ArrayList<>();
        for (int i=0;i<arr.length-1;i++){
            if (arr[i+1]-arr[i]==min){
                ans.add(Arrays.asList(arr[i],arr[i+1]));
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1200().minimumAbsDifference(new int[]{3,8,-10,23,19,-4,-14,27}));
    }
}
